<?php defined('SYSPATH') or die('No direct script access.');

// URL: /<context>/index.php/Profile/
class Controller_User extends Controller_Base 
{
	
	private $logger;
	
	public function __construct(Request $request, Response $response)
	{
		parent::__construct($request, $response);
		
		$this->logger = Logger::getLogger("seednia");
	}

	
	/**
	 * View profile
	 * 
	 */
	public function action_view()
	{
		$this->template->title = __('Welcome Seednia');
		$this->template->scripts = array('public/js/home.js');
	
		$content = View::factory($this->_theme.'/user_view');
	
		try {
			$sid = $this->request->query('sid'); // ->post('sid');
			$content->user = $this->userService->getByXid($sid);
				
			$this->template->content = $content;
		} catch (Exception $ex)
		{
			Kohana_Log::instance()->add(Kohana_Log::ERROR, 'Exception::Add Lis | Message: ' . $ex->getMessage());
		}
	}
	
} // End Controller_Home